## Table A3: Effects of Neighborhood Race and Income on Wait Times: Deciles

## install.packages(c("tidyverse", "fixest"))
## library(tidyverse)

## SET WORKING DIRECTORY HERE
## setwd()

## Loading data
## load("dta.RData")

## Column 1
race_wait_across_decile <- feols(log_wait_time ~ factor(white_decile) |
                                   city^open_month^open_year, data = dta, cluster = "geo")

## Column 2
race_wait_within_decile <- feols(log_wait_time ~ factor(white_decile) |
                                   city_service^open_month^open_year, data = dta, cluster = "geo")

## Column 3
inc_wait_across_decile <- feols(log_wait_time ~ factor(inc_decile) |
                                  city^open_month^open_year, data = dta, cluster = "geo")

## Column 4
inc_wait_within_decile <- feols(log_wait_time ~ factor(inc_decile) |
                                  city_service^open_month^open_year, data = dta, cluster = "geo")

TableA3 = etable(race_wait_across_decile, race_wait_within_decile,
                 inc_wait_across_decile, inc_wait_within_decile,
                 signifCode = c("+" = 0.10, "*" = 0.05, "**" = 0.01, "***" = 0.001),
                 digits = 3, digits.stats = 3, fitstat =c("n","r2"))
